import os

import pandas as pd
import numpy as np
import csv

# origin_path = "data/empty-lines-deleted"
# output_path = "data/deleted-and-transposed"
# for filename in os.listdir(origin_path):
#     df = pd.read_csv(os.path.join(origin_path, filename), header=None, low_memory=False)
#     # df.values
#     data = df.values
#     print(data)
#     data = list(map(list, zip(*data)))
#     # print(data)
#     data = pd.DataFrame(data)
#     print(data)
#     data.to_csv(os.path.join(output_path, filename), header=0, index=0)
#
df = pd.read_csv("data/population/API_SP.POP.TOTL_DS2_en_csv_v2_4770387.csv", header=None, low_memory=False)
# df.values
data = df.values
print(data)
data = list(map(list, zip(*data)))
# print(data)
data = pd.DataFrame(data)
print(data)
data.to_csv("data/population/population.csv", header=0, index=0)
